package com.zw.cloud.mybatis.plus.controller.stenter;


import cn.hutool.core.lang.tree.Tree;
import com.zw.cloud.mybatis.plus.service.api.stenter.IBaseDictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 公共字典表 前端控制器
 * </p>
 *
 * @author zw
 * @since 2023-11-30
 */
@RestController
@RequestMapping("/base-dictionary")
public class BaseDictionaryController {

    @Autowired
    private IBaseDictionaryService baseDictionaryService;

    @GetMapping("/treeList/{groupCode}")
    //http://localhost:8082/base-dictionary/treeList/ADDITIVES_TYPE_CONFIG
    public List<Tree<String>> treeList(@PathVariable String groupCode) {
        return baseDictionaryService.treeList(groupCode);
    }
}
